<%if(session.getAttribute("uname")==null)
{
	response.sendRedirect("login.jsp?msg=You need to log in first");
}
%>
<%@page import="java.io.*"%>
<%@page import="java.sql.*"%>
<%@ page import="com.hline.kbcss.MyDriver"%>
<%
try
{
	
	String qn=request.getParameter("value");
	String qid=request.getParameter("id");
	String tn=request.getParameter("tn");
	String fn=request.getParameter("fn");
	String tid=request.getParameter("tid");
		System.out.println("your support is"+qn);
			System.out.println("article is"+qid);
	
	Statement st=MyDriver.getConnection("READ");
	ResultSet rs=st.executeQuery("select "+qn+" from "+tn+" where "+tid+"='"+qid+"'");
	
	
	if(rs.next())
	{ int ans=0;
		ans=rs.getInt(qn);
		 ans++;
	String str="update "+tn+" set "+qn+"='"+ans+"' where "+tid+"='"+qid+"' ";
	int i=st.executeUpdate(str);
	response.sendRedirect(fn);
	
	
	}


}catch (Exception e)
{
	System.out.println(e);
  //response.sendRedirect("modifyum.jsp?message=<p><strong>not      updated</strong></p>");
}
%>